Skip to content

Add SystemError.Is for errors.Is context matching (#934) - #934

Open
justinhwang wants to merge 1 commit into
devfrom
system-error-is-context
Open

Add SystemError.Is for errors.Is context matching (#934)#934
justinhwang wants to merge 1 commit into
devfrom
system-error-is-context

Conversation

@justinhwang

Copy link
Copy Markdown

SystemError now implements Is so errors.Is(err, context.DeadlineExceeded) and errors.Is(err, context.Canceled) match tchannel timeout and cancellation errors respectively. Matching is keyed on the wire error code, so timeouts and cancellations from non-Go peers match too. This also matches remote and relay timeouts, so callers that must distinguish a local context expiry from a downstream one should still check ctx.Err().

Also fix CI: bump actions/checkout (v2 -> v7) and actions/setup-go (v5 -> v7), run checkout before setup-go with cache-dependency-path so module caching works, drop the dead glide actions/cache step (no glide.lock/vendor in the repo), and exclude stdlib internal/synctest from check_no_test_deps (Go 1.25+ pulls it into prod deps and its name trips the test grep, as internal/testlog already does).

SystemError now implements Is so errors.Is(err, context.DeadlineExceeded) and errors.Is(err, context.Canceled) match tchannel timeout and cancellation errors respectively. Matching is keyed on the wire error code, so timeouts and cancellations from non-Go peers match too. This also matches remote and relay timeouts, so callers that must distinguish a local context expiry from a downstream one should still check ctx.Err().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@justinhwang
justinhwang force-pushed the system-error-is-context branch from 499567e to a55fc1d Compare August 4, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant